package com.aternity.vbd.collect;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;

import java.util.*;

/**
 * @author Daniel Orr
 */
public class ApplicationsData {


    final Multimap<String, ActivityData> data = ArrayListMultimap.create();
    final Map<Integer, ActivityData> id2data = new HashMap<>();


    public void add(String app, Integer activityId, String activityName) {
        final ActivityData activityData = new ActivityData(activityId, activityName);
        data.put(app, activityData);
        id2data.put(activityId, activityData);
    }

    public Collection<ActivityData> getActivityData(String app) {
        return data.get(app);
    }

    public Set<String> getAppNames() {
        return data.keySet();
    }

    public ActivityData getActivityDataById(Integer id) {
        return id2data.get(id);
    }
}
